## Replicate Text Statistics regarding St. Louis Metro Area
## Andrew Reeves and Ryan T. Moore
## First: 9 February 2017
## Last: 15 December 2019

## Data from http://mcdc.missouri.edu/cgi-bin/broker

stlData <- read.csv("stlouis-mcdc.csv")

## 35% of the [St. Louis]’s census blocks are over 90% white or black.
nrow(subset(stlData, stlData$PctWhite1>90 | stlData$PctBlack1 >90)) / nrow(stlData)
# [1] 0.3485434

## footnote 4: Of St. Louis’s 9,577 census blocks, 1,315 are over 90% white while 2,023 are over 90% black.
nrow(stlData)
# [1] 9577
nrow(subset(stlData, stlData$PctWhite1>90))
# [1] 1315
nrow(subset(stlData, stlData$PctBlack1>90))
# [1] 2023



## Summary log of MCDC download tool
# Dexter Data Extraction Utility Tool 
# Version: 2.3, Revised: 9/12/2016 10:55:59 AM 
# Summary Log for Job ID: 03FEB17_00012
# Execution begins on 03FEB17 at 10:46  
# Path: /pub/data/sf12010x  Dataset: moblocks (dataset from which data are being extracted)
# 
# Output file(s) to be generated:
#   
#   Delimited file (csv format)
# Important note: These files will usually remain accessible for 48 hours on this server 
# 8 variables selected with a total length of 52 bytes. 
# Variables kept on output file(s)/dataset were: 
#   SumLev esriid AreaName Stab TotPop PctWhite1 PctBlack1 .
# 
# 9577 rows/observations were selected using the filter: 
#   SumLev IN ("101") and County IN ("29510"," ") 
# csv delimited file has been generated.
# 
# Output directory details:
#   
# -rw-r--r-- 1 apache apache    994 Feb  3 10:46 dexter_log.html
# -rw-r--r-- 1 apache apache 420054 Feb  3 10:46 xtract.csv
# -rw-r--r-- 1 apache apache 712704 Feb  3 10:46 xtract.sas7bdat
# Execution completed at 10:46 on 03FEB2017.